home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_i.lzh / libraries / configregs.i < prev    next >
Text File  |  1991-03-14  |  9KB  |  247 lines

  1.     IFND    LIBRARIES_CONFIGREGS_I
  2. LIBRARIES_CONFIGREGS_I    SET    1
  3. **
  4. **    $Filename: libraries/configregs.i $
  5. **    $Release: 2.04 $
  6. **    $Revision: 36.11 $
  7. **    $Date: 90/11/03 $
  8. **
  9. **    AutoConfig (tm) hardware register and bit definitions
  10. **
  11. **    (C) Copyright 1985,1989,1990 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. **
  14.  
  15.     IFND    EXEC_TYPES_I
  16.     INCLUDE    "exec/types.i"
  17.     ENDC    ;EXEC_TYPES_I
  18.  
  19. **
  20. ** AutoConfig (tm) boards each contain a 32 byte "ExpansionRom" area that is
  21. ** read by the system software at configuration time.  Configuration of each
  22. ** board starts when the ConfigIn* signal is passed from the previous board
  23. ** (or from the system for the first board).  Each board will present it's
  24. ** ExpansionRom structure at location $00E80000 to be read by the system.
  25. ** This file defines the appearance of the ExpansionRom area.
  26. **
  27. ** Expansion boards are actually organized such that only one nybble per
  28. ** 16 bit word contains valid information.  The low nybbles of each
  29. ** word are combined to fill the structure below. (This table is structured
  30. ** as LOGICAL information.  This means that it never corresponds exactly
  31. ** with a physical implementation.)
  32. **
  33. ** The ExpansionRom space is further split into two regions:  The first 16
  34. ** bytes are read-only.  Except for the er_type field, this area is inverted
  35. ** by the system software when read in.  The second 16 bytes contain the
  36. ** control portion, where all read/write registers are located.
  37. **
  38. ** The system builds one "ConfigDev" structure for each board found.  The
  39. ** list of boards can be examined using the expansion.library/FindConfigDev
  40. ** function.
  41. **
  42. ** A special "hacker" Manufacturer ID number is reserved for test use:
  43. ** 2011 ($7DB).  When inverted this will look like $F824.
  44. **
  45.  
  46.  STRUCTURE ExpansionRom,0    ;-First 16 bytes of the expansion ROM
  47.     UBYTE    er_Type     ;Board type, size and flags
  48.     UBYTE    er_Product    ;Product number, assigned by manufacturer
  49.     UBYTE    er_Flags    ;Flags
  50.     UBYTE    er_Reserved03    ;Must be zero ($ff inverted)
  51.     UWORD    er_Manufacturer ;Unique ID,ASSIGNED BY COMMODORE-AMIGA!
  52.     ULONG    er_SerialNumber ;Available for use by manufacturer
  53.     UWORD    er_InitDiagVec    ;Offset to optional "DiagArea" structure
  54.     UBYTE    er_Reserved0c
  55.     UBYTE    er_Reserved0d
  56.     UBYTE    er_Reserved0e
  57.     UBYTE    er_Reserved0f
  58.     LABEL    ExpansionRom_SIZEOF
  59.  
  60.  
  61. **
  62. ** Note that use of the ec_BaseAddress register is tricky.  The system
  63. ** will actually write twice.  First the low order nybble is written
  64. ** to the ec_BaseAddress register+2 (D15-D12).  Then the entire byte is
  65. ** written to ec_BaseAddress (D15-D8).  This allows writing of a byte-wide
  66. ** address to nybble size registers.
  67. **
  68.  
  69.  STRUCTURE ExpansionControl,0    ;-Second 16 bytes of the expansion ROM
  70.     UBYTE    ec_Interrupt    ;Optional interrupt control register
  71.     UBYTE    ec_Z3_HighBase    ;Zorro III   : Bits 24-31 of config address
  72.     UBYTE    ec_BaseAddress    ;Zorro II/III: Bits 16-23 of config address
  73.     UBYTE    ec_Shutup    ;The system writes here to shut up a board
  74.     UBYTE    ec_Reserved14
  75.     UBYTE    ec_Reserved15
  76.     UBYTE    ec_Reserved16
  77.     UBYTE    ec_Reserved17
  78.     UBYTE    ec_Reserved18
  79.     UBYTE    ec_Reserved19
  80.     UBYTE    ec_Reserved1a
  81.     UBYTE    ec_Reserved1b
  82.     UBYTE    ec_Reserved1c
  83.     UBYTE    ec_Reserved1d
  84.     UBYTE    ec_Reserved1e
  85.     UBYTE    ec_Reserved1f
  86.     LABEL    ExpansionControl_SIZEOF
  87.  
  88. **
  89. ** many of the constants below consist of a triplet of equivalent
  90. ** definitions: xxMASK is a bit mask of those bits that matter.
  91. ** xxBIT is the starting bit number of the field.  xxSIZE is the
  92. ** number of bits that make up the definition.    This method is
  93. ** used when the field is larger than one bit.
  94. **
  95. ** If the field is only one bit wide then the xxB_xx and xxF_xx convention
  96. ** is used (xxB_xx is the bit number, and xxF_xx is mask of the bit).
  97. **
  98.  
  99. ** manifest constants **
  100. E_SLOTSIZE        EQU    $10000
  101. E_SLOTMASK        EQU    $ffff
  102. E_SLOTSHIFT        EQU    16
  103.  
  104.  
  105. ** these define the free regions of Zorro memory space.
  106. ** THESE MAY WELL CHANGE FOR FUTURE PRODUCTS!
  107. E_EXPANSIONBASE     EQU    $00e80000    ;Zorro II  config address
  108. EZ3_EXPANSIONBASE    EQU    $ff000000    ;Zorro III config address
  109.  
  110. E_EXPANSIONSIZE     EQU    $00080000    ;Zorro II  I/O type cards
  111. E_EXPANSIONSLOTS    EQU    8
  112.  
  113. E_MEMORYBASE        EQU    $00200000    ;Zorro II  8MB space
  114. E_MEMORYSIZE        EQU    $00800000
  115. E_MEMORYSLOTS        EQU    128
  116.  
  117. EZ3_CONFIGAREA        EQU    $40000000    ;Zorro III space
  118. EZ3_CONFIGAREAEND    EQU    $7FFFFFFF    ;Zorro III space
  119. EZ3_SIZEGRANULARITY    EQU    $00080000    ;512K increments
  120.  
  121.  
  122. ***** er_Type definitions (ttldcmmm) ****************************************
  123.  
  124. ** er_Type board type bits -- the OS ignores "old style" boards **
  125. ERT_TYPEMASK        EQU    $c0    ;Bits 7-6
  126. ERT_TYPEBIT        EQU    6
  127. ERT_TYPESIZE        EQU    2
  128. ERT_NEWBOARD        EQU    $c0
  129. ERT_ZORROII        EQU    ERT_NEWBOARD
  130. ERT_ZORROIII        EQU    $80
  131.  
  132. ** other bits defined in er_Type **
  133.     BITDEF    ERT,MEMLIST,5        ; Link RAM into free memory list
  134.     BITDEF    ERT,DIAGVALID,4     ; ROM vector is valid
  135.     BITDEF    ERT,CHAINEDCONFIG,3    ; Next config is part of the same card
  136.  
  137. ** er_Type field memory size bits **
  138. ERT_MEMMASK        EQU    $07    ;Bits 2-0
  139. ERT_MEMBIT        EQU    0
  140. ERT_MEMSIZE        EQU    3
  141.  
  142.  
  143.  
  144. ***** er_Flags byte -- for those things that didn't fit into the type byte ****
  145. ***** the hardware stores this byte in inverted form               ****
  146.     BITDEF    ERF,MEMSPACE,7        ; Wants to be in 8 meg space.
  147.                     ; (NOT IMPLEMENTED)
  148.  
  149.     BITDEF    ERF,NOSHUTUP,6        ; Board can't be shut up.
  150.  
  151.     BITDEF    ERF,EXTENDED,5        ; Zorro III: Use extended size table
  152.                     ;         for bits 0-2 of er_Type.
  153.                     ; Zorro II : Must be 0
  154.  
  155.     BITDEF    ERF,ZORRO_III,4     ; Zorro III: must be 1
  156.                     ; Zorro II : must be 0
  157.  
  158. ERT_Z3_SSMASK        EQU    $0F    ; Bits 3-0.  Zorro III Sub-Size.  How
  159. ERT_Z3_SSBIT        EQU    0    ; much space the card actually uses
  160. ERT_Z3_SSSIZE        EQU    4    ; (regardless of config granularity)
  161.                     ; Zorro II : must be 0
  162.  
  163.  
  164. ** ec_Interrupt register (unused) *********************************************
  165.     BITDEF    ECI,INTENA,1
  166.     BITDEF    ECI,RESET,3
  167.     BITDEF    ECI,INT2PEND,4
  168.     BITDEF    ECI,INT6PEND,5
  169.     BITDEF    ECI,INT7PEND,6
  170.     BITDEF    ECI,INTERRUPTING,7
  171.  
  172.  
  173. **************************************************************************
  174. **
  175. ** these are the specifications for the diagnostic area.  If the Diagnostic
  176. ** Address Valid bit is set in the Board Type byte (the first byte in
  177. ** expansion space) then the Diag Init vector contains a valid offset.
  178. **
  179. ** The Diag Init vector is actually a word offset from the base of the
  180. ** board.  The resulting address points to the base of the DiagArea
  181. ** structure.  The structure may be physically implemented either four,
  182. ** eight, or sixteen bits wide.  The code will be copied out into
  183. ** ram first before being called.
  184. **
  185. ** The da_Size field, and both code offsets (da_DiagPoint and da_BootPoint)
  186. ** are offsets from the diag area AFTER it has been copied into ram, and
  187. ** "de-nybbleized" (if needed). (In other words, the byte size is the size of
  188. ** the actual information, not how much address space is required to
  189. ** store it.)
  190. **
  191. ** All bits are encoded with uninverted logic (e.g. 5 volts on the bus
  192. ** is a logic one).
  193. **
  194. ** If your board is to make use of the boot facility then it must leave
  195. ** its config area available even after it has been configured.  Your
  196. ** boot vector will be called AFTER your board's final address has been
  197. ** set.
  198. **
  199. **************************************************************************
  200.  
  201.  STRUCTURE DiagArea,0
  202.     UBYTE    da_Config    ; see below for definitions
  203.     UBYTE    da_Flags    ; see below for definitions
  204.     UWORD    da_Size    ; the size (in bytes) of the total diag area
  205.     UWORD    da_DiagPoint    ; where to start for diagnostics, or zero
  206.     UWORD    da_BootPoint    ; where to start for booting
  207.     UWORD    da_Name    ; offset in diag area where a string
  208.                 ;   identifier can be found (or zero if no
  209.                 ;   identifier is present).
  210.  
  211.     UWORD    da_Reserved01    ; two words of reserved data.  must be zero.
  212.     UWORD    da_Reserved02
  213.     LABEL    DiagArea_SIZEOF
  214.  
  215. ; da_Config definitions
  216. **
  217. ** DAC_BYTEWIDE can be simulated using DAC_NIBBLEWIDE.
  218. **
  219. DAC_BUSWIDTH    EQU    $C0    ; two bits for bus width
  220. DAC_NIBBLEWIDE    EQU    $00    ; (indicates information is nybble wide)
  221. DAC_BYTEWIDE    EQU    $40    ; BUG: Will not work under V34 Kickstart!
  222. DAC_WORDWIDE    EQU    $80
  223.  
  224. DAC_BOOTTIME    EQU    $30    ; two bits for when to boot
  225. DAC_NEVER    EQU    $00    ; obvious
  226. DAC_CONFIGTIME    EQU    $10    ; call da_BootPoint when first configing
  227.                 ;   the device
  228. DAC_BINDTIME    EQU    $20    ; run when binding drivers to boards
  229.  
  230. **
  231. ** These are the calling conventions for the diagnostic callback
  232. ** (from da_DiagPoint).
  233. **
  234. ** A7 -- points to at least 2K of stack
  235. ** A6 -- ExecBase
  236. ** A5 -- ExpansionBase
  237. ** A3 -- your board's ConfigDev structure
  238. ** A2 -- Base of diag/init area that was copied
  239. ** A0 -- Base of your board
  240. **
  241. ** Your board must return a value in D0.  If this value is NULL, then
  242. ** the diag/init area that was copied in will be returned to the free
  243. ** memory pool.
  244. **
  245.  
  246.     ENDC    ;LIBRARIES_CONFIGREGS_I
  247.